﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YmtUserAuth.DataImport
{
    public class UserData
    {
        public int _id { get; set; }
        public Dictionary<string, object> Value { get; set; }

        /// <summary>
        /// 生成用户数据
        /// </summary>
        /// <param name="loginId"></param>       
        /// <param name="email"></param>
        /// <param name="userId"></param>
        /// <param name="tradingPassword"></param>
        /// <returns></returns>
        public static UserData Create(int userId, string loginId, string tradingPassword, string email)
        {
            //生成用户value 值
            if (tradingPassword == "NULL") tradingPassword = "";
            var value = new Dictionary<string, object> 
            {
                {"iUserId",userId},
                {"sLoginId",loginId},
                {"sTradingPassword",tradingPassword},
                {"sLoginEmail",email}
            };
            //按不同认证策略生成用户
            return new UserData
           {
               _id = userId,
               Value = value
           };
        }
    }
}
